package me.idashu.attg.service;

import java.util.List;
import java.util.Map;

import me.idashu.attg.domain.CommentEntity;
import me.idashu.attg.persistence.CommentMapper;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class CommentService {
    @Autowired
    private CommentMapper commentMapper;
    
    public List<CommentEntity> viewComment(Map<String, Object> map){
    	return commentMapper.viewComment(map);
    }
    
    public int commentCount(int noteId){
    	return commentMapper.commentCount(noteId);
    }
    
    public void insertComment(CommentEntity commentEntity){
    	commentMapper.insertComment(commentEntity);
    }
    
    public List<CommentEntity> findCommentByNoteId(int noteId){
    	return commentMapper.findCommentByNoteId(noteId);
    }
    
    public void deleteComment(int id){
    	commentMapper.deleteComment(id);
    }
}
